package com.itheima.controller;

import com.itheima.pojo.*;
import com.itheima.service.EmpService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author hu
 * @date 2025/3/10
 */
@RestController
@RequestMapping("/login")
@Slf4j
public class LoginInfoController {

    @Resource
    private EmpService empService;

    @PostMapping
    public Result login(@RequestBody Emp emp) {
        log.info("接受请求参数：{}", emp);
        LoginInfo info = empService.login(emp);
        if (info != null) {
            return Result.success(info);
        }
        return null;
    }



}
